Configuration Scripts
To guarantee processing in the script environment the internal names of the enaio® object types have to be structured as follows: names start with letters from a to z or from A to Z or with the characters _ or &. After this, the characters 0 to 9, a to z, A to Z, _ or $ can be used. The names of variables are case-sensitive.
The following names are reserved and cannot be used as variable names: or, and, eq, ne, lt, gt, le, ge, div, mod, not, null, true, false, and new.
You can use the scripting language described below to assign the index data fields in the OSMetadata.xml configuration file from enaio® to the enaio® apps fields.
Statements | Use a semicolon to terminate statements. |
Blocks | Blocks are different statements enclosed by braces. |
Assignments | Values can be assigned to variables using the equals sign: var='Value'. |
Integer | One or more digits from 0 to 9. |
Floating Point | One or more digits from 0 to 9 followed by a decimal point and further digits from 0 to 9. |
Boolean | true or false |
String | Strings enclosed by single quotation marks: 'Hello world.' |
empty | Returns true if the following expression is null. An empty string, for example, empty(var1). |
size | Returns the length of a string, for example size('Hello'). |
Logical operators |
AND: cond1 and cond2 cond1 && cond2 OR: cond1 or cond2 cond1 || cond2 NOT: !cond1 not cond1 |
Conditional operators |
The common operator "condition ? if_true : if_false" as well as the short form "value ?: if_false" can be used. For example, val1 ? val1 : val2 val1 ?: val2 |
Relational operators |
val1 == val2 val1 eq val2 val1 != val2 val1 ne val2 val1 < val2 val1 lt val2 val1 <= val2 val1 le val2 val1 >= val2 val1 ge val2 |
Regular expressions |
var1 =~ 'abc.*' var1 !~ 'abc.*' |
Calculations |
The operations of addition, subtraction, multiplication, and division can be carried out: val1 + val2 val1 - val2 val1 * val2 val1 / val2 val1 div val2 |
if |
if ((x * 2) == 5) { y = 1; } else { y = 2; } |